home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEparticleCloudTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  10.5 KB  |  344 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    May 20, 1997
  21. //  Author:        sw
  22. //
  23. //  Procedure Name:
  24. //    AEparticleCloudTemplate
  25. //
  26. //  Description Name;
  27. //    Creates the attribute editor controls for the particleCloud Node
  28. //
  29. //  Input Value:
  30. //    nodeName 
  31. //
  32. //  Output Value:
  33. //    None
  34. // 
  35.  
  36. global proc AEstandardControlsNew ( string $color, 
  37.                                     string $transparency, 
  38.                                     string $incandescence )
  39. {
  40.     setUITemplate -pst attributeEditorTemplate;
  41.  
  42.     if (`licenseCheck -mode edit -type fx`)
  43.     {
  44.         attrColorSliderGrp -l "Color"
  45.             -at $color
  46.             particleColorControl;
  47.         
  48.         attrColorSliderGrp -l "Transparency"
  49.             -at $transparency
  50.             particleTransparencyControl;
  51.         
  52.         attrColorSliderGrp -l "Incandescence"
  53.             -at $incandescence
  54.             particleIncandescenceControl;
  55.     }
  56.     else
  57.     {
  58.         attrColorSliderGrp -l "Color"
  59.             -at $color
  60.             -enable false
  61.             particleColorControl;
  62.        
  63.         attrColorSliderGrp -l "Transparency"
  64.             -at $transparency
  65.             -enable false
  66.             particleTransparencyControl;
  67.        
  68.         attrColorSliderGrp -l "Incandescence"
  69.             -at $incandescence
  70.             -enable false
  71.             particleIncandescenceControl;
  72.     }
  73.     
  74.     setUITemplate -ppt;
  75. }
  76.  
  77. global proc AEstandardControlsReplace ( string $color,
  78.                                         string $transparency,
  79.                                         string $incandescence )
  80. {
  81.     attrColorSliderGrp -edit
  82.         -at $color
  83.         particleColorControl;
  84.  
  85.     attrColorSliderGrp -edit
  86.         -at $transparency
  87.         particleTransparencyControl;
  88.  
  89.     attrColorSliderGrp -edit
  90.         -at $incandescence
  91.         particleIncandescenceControl;
  92. }
  93.  
  94. global proc AElifeControlsNew ( string $color, 
  95.                                 string $transparency, 
  96.                                 string $incandescence )
  97. {
  98.     setUITemplate -pst attributeEditorTemplate;
  99.  
  100.     if (`licenseCheck -mode edit -type fx`)
  101.     {
  102.         attrNavigationControlGrp -l "Life Color"
  103.             -and $color "particleSamplerInfo"
  104.             lifeColorControl;
  105.         
  106.         attrNavigationControlGrp -l "Life Transparency"
  107.             -and $transparency "particleSamplerInfo"
  108.             lifeTransparencyControl;
  109.         
  110.         attrNavigationControlGrp -l "Life Incandescence"
  111.             -and $incandescence "particleSamplerInfo"
  112.             lifeIncandescenceControl;
  113.     }
  114.     else
  115.     {
  116.         attrNavigationControlGrp -l "Life Color"
  117.             -and $color "particleSamplerInfo"
  118.             -enable false
  119.             lifeColorControl;
  120.  
  121.         attrNavigationControlGrp -l "Life Transparency"
  122.             -and $transparency "particleSamplerInfo"
  123.             -enable false
  124.             lifeTransparencyControl;
  125.  
  126.         attrNavigationControlGrp -l "Life Incandescence"
  127.             -and $incandescence "particleSamplerInfo"
  128.             -enable false
  129.             lifeIncandescenceControl;
  130.     }
  131.     
  132.     setUITemplate -ppt;
  133. }    
  134.  
  135. global proc AElifeControlsReplace ( string $color,
  136.                                     string $transparency,
  137.                                     string $incandescence )
  138. {
  139.     attrNavigationControlGrp -edit
  140.         -and $color "particleSamplerInfo"
  141.         lifeColorControl;
  142.  
  143.     attrNavigationControlGrp -edit
  144.         -and $transparency "particleSamplerInfo"
  145.         lifeTransparencyControl;
  146.  
  147.     attrNavigationControlGrp -edit
  148.         -and $incandescence "particleSamplerInfo"
  149.         lifeIncandescenceControl;
  150. }
  151.  
  152. global proc licenseGlowIntensity ( string $nodeName )
  153. {
  154.     if (!`licenseCheck -mode edit -type fx`)
  155.         editorTemplate -dimControl $nodeName "glowIntensity" true;
  156. }
  157.  
  158. global proc licenseDensity ( string $nodeName )
  159. {
  160.     if (!`licenseCheck -mode edit -type fx`)
  161.         editorTemplate -dimControl $nodeName "density" true;
  162. }
  163.  
  164. global proc licenseNoise ( string $nodeName )
  165. {
  166.     if (!`licenseCheck -mode edit -type fx`) {
  167.         editorTemplate -dimControl $nodeName "noise" true;
  168.         editorTemplate -dimControl $nodeName "noiseFreq" true;
  169.         editorTemplate -dimControl $nodeName "noiseAspect" true;
  170.         editorTemplate -dimControl $nodeName "noiseAnimRate" true;
  171.         editorTemplate -dimControl $nodeName "solidCoreSize" true;
  172.     } else {
  173.         string $nodeAttr = $nodeName + ".noise";
  174.  
  175.         // Dim out noise only if it is 0.0 and not connected.
  176.         // If it is connected, it is probably to a ramp or param
  177.         // curve and we want to leave the other attributes enabled,
  178.         // even if the value at this moment happens to be 0.0.
  179.         //
  180.         float $noise = `getAttr $nodeAttr`;
  181.         string $conn[] = `listConnections $nodeAttr`;        
  182.         if( (size($conn) == 0) && ($noise == 0.0) ) {
  183.             editorTemplate -dimControl $nodeName "noise" false;
  184.             editorTemplate -dimControl $nodeName "noiseFreq" true;
  185.             editorTemplate -dimControl $nodeName "noiseAspect" true;
  186.             editorTemplate -dimControl $nodeName "noiseAnimRate" true;
  187.             editorTemplate -dimControl $nodeName "solidCoreSize" true;
  188.         } else {
  189.             editorTemplate -dimControl $nodeName "noise" false;
  190.             editorTemplate -dimControl $nodeName "noiseFreq" false;
  191.             editorTemplate -dimControl $nodeName "noiseAspect" false;
  192.             editorTemplate -dimControl $nodeName "noiseAnimRate" false;
  193.             editorTemplate -dimControl $nodeName "solidCoreSize" false;
  194.         }
  195.     }
  196. }
  197.  
  198. global proc licenseBlobMap ( string $nodeName )
  199. {
  200.     if (!`licenseCheck -mode edit -type fx`)
  201.         editorTemplate -dimControl $nodeName "blobMap" true;
  202. }
  203.  
  204. global proc licenseFilterRadius ( string $nodeName )
  205. {
  206.     if (!`licenseCheck -mode edit -type fx`)
  207.         editorTemplate -dimControl $nodeName "filterRadius" true;
  208. }
  209.  
  210. global proc licenseTranslucence ( string $nodeName )
  211. {
  212.     if (!`licenseCheck -mode edit -type fx`)
  213.         editorTemplate -dimControl $nodeName "translucence" true;
  214. }
  215.  
  216. global proc licenseDiffuseCoeff ( string $nodeName )
  217. {
  218.     if (!`licenseCheck -mode edit -type fx`) {
  219.         editorTemplate -dimControl $nodeName "diffuseCoeff" true;
  220.         editorTemplate -dimControl $nodeName "surfaceColor" true;
  221.         editorTemplate -dimControl $nodeName "normalCamera" true;
  222.         editorTemplate -dimControl $nodeName "translucenceCoeff" true;
  223.         editorTemplate -dimControl $nodeName "surfaceShadingShadow" true;
  224.     } else {
  225.         // Dim out diffuse coeff only if it is 0.0 and not connected.
  226.         // If it is connected, it is probably to a ramp or param
  227.         // curve and we want to leave the other attributes enabled,
  228.         // even if the value at this moment happens to be 0.0.
  229.         //
  230.         string $nodeAttr = $nodeName + ".diffuseCoeff";
  231.         float $diffuseCoeff = `getAttr $nodeAttr`;
  232.         string $conn[] = `listConnections $nodeAttr`;        
  233.         if( (size($conn) == 0) && ($diffuseCoeff == 0.0) ) {
  234.             editorTemplate -dimControl $nodeName "diffuseCoeff" false;
  235.             editorTemplate -dimControl $nodeName "surfaceColor" true;
  236.             editorTemplate -dimControl $nodeName "normalCamera" true;
  237.             editorTemplate -dimControl $nodeName "translucenceCoeff" true;
  238.             editorTemplate -dimControl $nodeName "surfaceShadingShadow" true;
  239.         } else {
  240.             editorTemplate -dimControl $nodeName "diffuseCoeff" false;
  241.             editorTemplate -dimControl $nodeName "surfaceColor" false;
  242.             editorTemplate -dimControl $nodeName "normalCamera" false;
  243.             editorTemplate -dimControl $nodeName "translucenceCoeff" false;
  244.             editorTemplate -dimControl $nodeName "surfaceShadingShadow" false;
  245.         }
  246.     }
  247. }
  248.  
  249. global proc licenseRoundness ( string $nodeName )
  250. {
  251.     if (!`licenseCheck -mode edit -type fx`)
  252.         editorTemplate -dimControl $nodeName "roundness" true;
  253. }
  254.  
  255. //
  256. //  Procedure Name:
  257. //     AEshaderBumpNew2
  258. //
  259.  
  260. global proc AEshaderBumpNew2 (string $attrName)
  261. {
  262.     setUITemplate -pst attributeEditorTemplate;
  263.  
  264.     attrNavigationControlGrp 
  265.         -l "Bump Mapping"
  266.         -at $attrName
  267.         bumpControl;
  268.  
  269.     setUITemplate -ppt;
  270. }
  271.  
  272.  
  273. //
  274. //  Procedure Name:
  275. //    AEshaderBumpReplace2
  276. //
  277.  
  278. global proc AEshaderBumpReplace2 (string $attrName)
  279. {
  280.     attrNavigationControlGrp -edit
  281.         -at $attrName
  282.         bumpControl;
  283. }
  284.  
  285. //
  286. //  Procedure Name:
  287. //    AElambertCommon
  288. //
  289.  
  290. global proc AEparticleCloudTemplate ( string $nodeName )
  291. {
  292.     AEswatchDisplay $nodeName;
  293.     editorTemplate -beginScrollLayout;
  294.  
  295.     editorTemplate -beginLayout "Common Material Attributes" -collapse 0;
  296.         editorTemplate -callCustom     "AEstandardControlsNew"
  297.                                     "AEstandardControlsReplace"
  298.                                     "color" "transparency" "incandescence";
  299.         editorTemplate -callCustom     "AElifeControlsNew"
  300.                                     "AElifeControlsReplace"
  301.                                     "color" "transparency" "incandescence";
  302.         editorTemplate -suppress "color";
  303.         editorTemplate -suppress "transparency";
  304.         editorTemplate -suppress "incandescence";
  305.         editorTemplate -addControl "glowIntensity" licenseGlowIntensity;
  306.     
  307.     editorTemplate -endLayout;
  308.  
  309.     editorTemplate -beginLayout "Transparency" -collapse 0;
  310.         editorTemplate -addControl "density" licenseDensity;
  311.         editorTemplate -addControl "blobMap" licenseBlobMap;
  312.         editorTemplate -addControl "roundness" licenseRoundness;
  313.         editorTemplate -addControl "translucence" licenseTranslucence;
  314.     editorTemplate -endLayout;
  315.  
  316.     editorTemplate -beginLayout "Built-in Noise" -collapse 0;
  317.         editorTemplate -addControl "noise" licenseNoise;
  318.         editorTemplate -addControl "noiseFreq";
  319.         editorTemplate -addControl "noiseAspect";
  320.         editorTemplate -addControl "noiseAnimRate";
  321.         editorTemplate -addControl "solidCoreSize";
  322.     editorTemplate -endLayout;
  323.  
  324.     editorTemplate -beginLayout "Surface Shading Properties" -collapse 0;
  325.         editorTemplate -addControl "diffuseCoeff" licenseDiffuseCoeff;
  326.         editorTemplate -addControl "surfaceColor";
  327.         editorTemplate -callCustom "AEshaderBumpNew2" "AEshaderBumpReplace2"
  328.                      "normalCamera";
  329.         editorTemplate -addControl "translucenceCoeff";
  330.         editorTemplate -addControl "surfaceShadingShadow";
  331.     editorTemplate -endLayout;
  332.  
  333.     editorTemplate -beginLayout "Pre-illumination Controls" -collapse 1;
  334.         editorTemplate -addControl "filterRadius" licenseFilterRadius;
  335.     editorTemplate -endLayout;
  336.  
  337.     editorTemplate -suppress "renderState";
  338.     
  339.     // include/call base class/node attributes
  340.     AEdependNodeTemplate $nodeName;
  341.     editorTemplate -addExtraControls;
  342.     editorTemplate -endScrollLayout;
  343. }
  344.